package com.cyt.chattlibrary.message.view;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;

import com.cyt.chattlibrary.R;
import com.cyt.chattlibrary.message.InformationNotificationMessage;
import com.cyt.chattlibrary.message.model.MessageContent;


public class InfoMsgView extends BaseMsgView {

    private TextView username;
    private TextView infoText;

    public InfoMsgView(Context context) {
        super(context);
        View view = LayoutInflater.from(getContext()).inflate(R.layout.msg_info_view, this);
        username = view.findViewById(R.id.username);
        infoText = view.findViewById(R.id.info_text);
    }

    @Override
    public void setContent(MessageContent msgContent) {
        InformationNotificationMessage msg = (InformationNotificationMessage) msgContent;
        username.setText(msg.getUserInfo().getName() + " ");
        infoText.setText(msg.getMessage());
    }
}
